<template>
  <a-card :bordered="false">
    <redirect :func="func" :id="id" :code="formCode" :fks="fks" @close="close" @refreshParent="refreshParent"
              @setTitle="setTitle" :processInstanceName="title"></redirect>
  </a-card>
</template>

<script>

  import Redirect from './Redirect'

  export default {
    name: 'RedirectPage',
    components: {
      Redirect
    },
    data () {
      return {
        func: null,
        id: null,
        formCode: null,
        fks: null,
        title: null
      }
    },
    methods: {
      //关闭页面
      close () {
        // //console.log("close");
      },
      //刷新父页面
      refreshParent () {
        // //console.log("refreshParent");
      },
      //设置标题
      setTitle (title) {
        this.title = title
        document.title = title
      }
    },
    created () {
      this.title = this.$t('m.bpm.common.bpmPage')
      document.title = this.title
      //改造，为了权限，只允许detailFromProcess和detailFromTask
      const func = this.$route.params.func
      if (func == 'detailFromProcess') {
        this.func = 'detailFromProcess'
      } else {
        this.func = 'detailFromTask'
      }
      this.id = this.$route.params.id
      this.formCode = this.$route.params.formCode
      const pkName = this.$route.params.pkName
      const pkValue = this.$route.params.pkValue
      if (pkName && pkValue) {
        this.fks = [{
          colCode: pkName,
          queryValue: pkValue
        }]
      }
    }
  }
</script>
